﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Administration;

namespace Umbrella.Whs.SharePoint.WebConfigModifications
{
    internal sealed class EnableDebugging : WebConfigModification
    {
        public override string Id
        {
            get { return "EnableDebugging"; }
        }

        protected override IEnumerable<SPWebConfigModification> CreateInternal()
        {
            return new[]
            {
                new SPWebConfigModification()
                {
                    Name = "debug",
                    Path = "/configuration/system.web/compilation",
                    Value = "true",
                    Type = SPWebConfigModification.SPWebConfigModificationType.EnsureAttribute,
                },
                new SPWebConfigModification()
                {
                    Name = "AllowPageLevelTrace",
                    Path = "/configuration/SharePoint/SafeMode",
                    Value = "true",
                    Type = SPWebConfigModification.SPWebConfigModificationType.EnsureAttribute,
                },
                new SPWebConfigModification()
                {
                    Name = "mode",
                    Path = "/configuration/system.web/customErrors",
                    Value = "Off",
                    Type = SPWebConfigModification.SPWebConfigModificationType.EnsureAttribute,
                },
            };
        }
    }
}
